home *** CD-ROM | disk | FTP | other *** search
/ USGS: Oil & Gas Fields of Asia Pacific / USGS Maps Showing Geology, Oil & Gas Fields of Asia Pacific.iso / pc / ASPAC / VIEWPC03 / SCRIPTS / ZOMINTOL.AVE < prev   
Text File  |  1999-03-10  |  3KB  |  107 lines

  1. ' zomintol.ave
  2. ' Integrates Arcview View.Zoomin.Tool system script to 
  3. ' Label Geology on the fly
  4. ' D.W. Steinshouer - GeoLukas for U.S.G.S. 
  5. ' World Energy Project
  6. ' Thomas Ahlbrandt   Project Chief
  7.  
  8.  
  9.  
  10. region3 = av.GetProject
  11. region3.SetModified(true)
  12. theView = av.GetActiveDoc
  13. r = theView.ReturnUserRect
  14. d = theView.GetDisplay
  15. if (r.IsNull) then
  16.   d.ZoomIn(125)
  17.   d.PanTo(d.ReturnUserPoint)
  18. else
  19.   d.ZoomToRect(r)  
  20. end
  21.  
  22. leg = region3.FindDoc("Geologic Legend")
  23. if (theView <> leg) then
  24.  
  25. ' geolabel.ave
  26. ' labels geology at scale > 1:10000000
  27. ' Douglas Steinshouer   11/14/98
  28. ' GeoLukas for USGS 
  29. ' World Energy Project
  30.  
  31. ' Defines the theme and clears existing labels
  32.  
  33. av.ShowMsg("Labeling geologic age ...")
  34. av.ShowStopButton
  35. av.SetStatus(0)
  36.  
  37. theView = av.GetActiveDoc
  38. theTheme = theView.GetThemes.Get(5)
  39. theTheme.SetActive(true)
  40. theTheme.GetGraphics.SelectLabels
  41. theTheme.GetGraphics.Invalidate
  42. theView.GetGraphics.ClearSelected
  43.  
  44. ' Determines scale of zoomed view
  45.  
  46. size = theView.GetDisplay.ReturnVisExtent
  47. tall = size.GetHeight
  48. long = size.GetWidth
  49.  
  50. ' Filters scale and draws labels
  51.  
  52.  if ((tall < 889000) AND (long < 1227670)) then
  53.    agelabel = Labeler.Make(size)
  54.    agelabel.SetFeatureWeight(#LABEL_WEIGHT_NO)
  55.    agelabel.SetLabelWeight(#LABEL_WEIGHT_HIGH)    
  56.    agesymbol = TextSymbol.Make
  57.    agesymbol.SetFont(Font.Make("Univers","Normal"))
  58.     if ((tall < 44450) AND (long < 61383)) then
  59.       agesymbol.SetSize(15)
  60.     elseif ((tall < 88900) AND (long < 122767)) then
  61.       agesymbol.SetSize(12)
  62.     elseif ((tall < 222250) AND (long < 306917)) then
  63.       agesymbol.SetSize(11)
  64.     elseif ((tall < 444500) AND (long < 613835)) then
  65.       agesymbol.SetSize(10)
  66.     elseif ((tall < 666751) AND (long < 920752)) then
  67.       agesymbol.SetSize(9)
  68.     else     
  69.       agesymbol.SetSize(8)
  70.     end
  71.    theTheme.SetLabelTextSym(agesymbol)
  72.    agelabel.Load(theTheme)
  73.    theView.GetAutoLabels(agelabel,true)
  74.  else
  75.    theTheme.GetGraphics.SelectLabels
  76.    theTheme.GetGraphics.Invalidate
  77.    theView.GetGraphics.ClearSelected
  78.  end
  79.  end
  80.  
  81. t2 = theView.GetThemes.Get(0)
  82. t2.SetActive(true)
  83. t2.GetGraphics.SelectLabels
  84. t2.GetGraphics.Invalidate
  85. theView.GetGraphics.ClearSelected
  86.  
  87. citylabel = Labeler.Make(size)
  88. citylabel.SetFeatureWeight(#LABEL_WEIGHT_NO)
  89. citylabel.SetLabelWeight(#LABEL_WEIGHT_HIGH)    
  90. citysymbol = TextSymbol.Make
  91. citysymbol.SetFont(Font.Make("Univers","Italic"))
  92. citysymbol.SetSize(10)
  93. t2.SetLabelTextSym(citysymbol)
  94. citylabel.Load(t2)
  95. theView.GetAutoLabels(citylabel,true)
  96.  
  97. ts = theView.GetThemes
  98.   for each t in ts
  99.     t.SetActive(false)
  100.   end
  101.  
  102.  
  103.  av.SetStatus(100)
  104.  av.ClearMsg
  105.  
  106.  
  107.